package com.java.simple.study.jvm.stringtable;

/**
 * @author zhoujunlin
 * @date 2022年09月04日 22:24
 * @desc debug查看堆中常量池中数据唯一不会重复
 */
public class StringTest3 {

    public static void main(String[] args) {
        System.out.println();   // 2482
        System.out.println("1"); //2483
        System.out.println("2");
        System.out.println("3");
        System.out.println("4");
        System.out.println("5");
        System.out.println("6");
        System.out.println("7");
        System.out.println("8");
        System.out.println("9"); //2491
        System.out.println("10"); //2492
        // 如下字符串"1"-"10"不会再次加载
        System.out.println("1"); //2493
        System.out.println("2"); //2493
        System.out.println("3");
        System.out.println("4");
        System.out.println("5");
        System.out.println("6");
        System.out.println("7");
        System.out.println("8");
        System.out.println("9");
        System.out.println("10");
    }

}
